﻿USE [Car_Rental]
GO
/****** Object:  Table [dbo].[WebManageUsers]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[WebManageUsers](
	[ManageUserID] [int] NOT NULL,
	[LoginName] [varchar](20) NOT NULL,
	[LoginNameSpell] [varchar](20) NOT NULL,
	[Password] [varchar](50) NOT NULL,
	[RealName] [varchar](20) NOT NULL,
	[Gender] [varchar](10) NOT NULL,
	[IntroductionURL] [varchar](500) NOT NULL,
	[Phone] [varchar](20) NULL,
	[Mobile] [varchar](20) NOT NULL,
	[Email] [varchar](50) NULL,
	[AvatarUrl] [varchar](300) NOT NULL,
	[QQ] [varchar](20) NULL,
	[MSN] [varchar](50) NULL,
	[Rtx] [varchar](20) NULL,
	[Birthday] [varchar](20) NULL,
	[Description] [nvarchar](max) NULL,
	[DepartmentID] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
	[UpdateDate] [datetime] NULL,
	[Operator] [varchar](50) NULL,
	[Status] [int] NOT NULL,
 CONSTRAINT [PK_dbo.WebManageUsers] PRIMARY KEY CLUSTERED 
(
	[ManageUserID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[WebManageUser_WebManageRoles]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[WebManageUser_WebManageRoles](
	[ManageUserID] [int] NOT NULL,
	[ManageRoleID] [int] NOT NULL,
 CONSTRAINT [PK_dbo.WebManageUser_WebManageRoles] PRIMARY KEY CLUSTERED 
(
	[ManageUserID] ASC,
	[ManageRoleID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[WebManageUser_Strategy]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[WebManageUser_Strategy](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[ManageUserID] [int] NOT NULL,
	[IPArea] [nvarchar](50) NULL,
	[BeginDate] [datetime] NOT NULL,
	[EndDate] [datetime] NOT NULL,
	[Status] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_dbo.WebManageUser_Strategy] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[WebManageRoles]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[WebManageRoles](
	[ManageRoleID] [int] NOT NULL,
	[RoleName] [varchar](50) NOT NULL,
	[DepartmentID] [int] NOT NULL,
	[About] [varchar](200) NOT NULL,
	[UpdateDate] [nchar](10) NOT NULL,
	[SortNumber] [int] NOT NULL,
	[Operator] [varchar](50) NOT NULL,
	[Status] [int] NOT NULL,
	[OperatorAuthority] [int] NOT NULL,
 CONSTRAINT [PK_dbo.WebManageRoles] PRIMARY KEY CLUSTERED 
(
	[ManageRoleID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[WebManageRole_WebManageMenus]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[WebManageRole_WebManageMenus](
	[MenuID] [int] NOT NULL,
	[ManageRoleID] [int] NOT NULL,
 CONSTRAINT [PK_dbo.WebManageRole_WebManageMenus] PRIMARY KEY CLUSTERED 
(
	[MenuID] ASC,
	[ManageRoleID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[WebManagePermissions]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[WebManagePermissions](
	[PermissionsID] [int] NOT NULL,
	[Name] [varchar](100) NOT NULL,
	[Status] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_dbo.WebManagePermissions] PRIMARY KEY CLUSTERED 
(
	[PermissionsID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[WebManageMenus]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[WebManageMenus](
	[MenuID] [int] NOT NULL,
	[MenuName] [varchar](50) NOT NULL,
	[ParentID] [int] NOT NULL,
	[MenuLevel] [int] NOT NULL,
	[LinkUrl] [varchar](300) NULL,
	[About] [varchar](200) NOT NULL,
	[SortNumber] [int] NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
	[Operator] [varchar](50) NULL,
	[Status] [int] NOT NULL,
 CONSTRAINT [PK_dbo.WebManageMenus] PRIMARY KEY CLUSTERED 
(
	[MenuID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[WebEntityLogs]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[WebEntityLogs](
	[ID] [bigint] IDENTITY(1,1) NOT NULL,
	[Title] [varchar](200) NULL,
	[Info] [varchar](max) NULL,
	[CreateDate] [datetime] NULL,
	[Operator] [varchar](100) NULL,
 CONSTRAINT [PK_dbo.WebEntityLogs] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[WebDepartments]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[WebDepartments](
	[DepartmentID] [int] NOT NULL,
	[DepartmentName] [varchar](50) NOT NULL,
	[About] [varchar](500) NOT NULL,
	[ParentID] [int] NOT NULL,
	[SortNumber] [int] NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
	[Operator] [varchar](50) NULL,
	[Status] [int] NOT NULL,
 CONSTRAINT [PK_dbo.WebDepartments] PRIMARY KEY CLUSTERED 
(
	[DepartmentID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[WebBankAccountRecords]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[WebBankAccountRecords](
	[WebBankAccountRecordID] [varchar](36) NOT NULL,
	[Amount] [decimal](18, 2) NOT NULL,
	[Balance] [decimal](18, 2) NOT NULL,
	[FlowType] [int] NOT NULL,
	[ActionType] [int] NOT NULL,
	[UserID] [varchar](12) NULL,
	[BankName] [varchar](50) NULL,
	[Note] [varchar](500) NULL,
	[CreateDate] [datetime] NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
	[Operator] [varchar](50) NULL,
	[Status] [int] NOT NULL,
 CONSTRAINT [PK_dbo.WebBankAccountRecords] PRIMARY KEY CLUSTERED 
(
	[WebBankAccountRecordID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[WebAccountRecords]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[WebAccountRecords](
	[WebAccountRecordID] [varchar](36) NOT NULL,
	[Amount] [decimal](18, 2) NOT NULL,
	[Balance] [decimal](18, 2) NOT NULL,
	[FlowType] [int] NOT NULL,
	[ActionType] [int] NOT NULL,
	[Note] [varchar](500) NULL,
	[SplitPercent] [int] NULL,
	[OrderID] [bigint] NULL,
	[CreateDate] [datetime] NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
	[Operator] [varchar](50) NULL,
	[Status] [int] NOT NULL,
 CONSTRAINT [PK_dbo.WebAccountRecords] PRIMARY KEY CLUSTERED 
(
	[WebAccountRecordID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[WebAccountFreezeRecords]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[WebAccountFreezeRecords](
	[WebAccountFreezeRecordID] [varchar](36) NOT NULL,
	[Amount] [decimal](18, 2) NOT NULL,
	[Type] [int] NOT NULL,
	[FreezeType] [int] NOT NULL,
	[OrderID] [bigint] NULL,
	[Note] [varchar](200) NOT NULL,
	[Status] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
	[Operator] [varchar](50) NOT NULL,
 CONSTRAINT [PK_dbo.WebAccountFreezeRecords] PRIMARY KEY CLUSTERED 
(
	[WebAccountFreezeRecordID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[WebAccountBalances]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[WebAccountBalances](
	[WebAccountBalanceID] [varchar](36) NOT NULL,
	[BankAcountBalance] [decimal](18, 2) NOT NULL,
	[TotalAccountBalance] [decimal](18, 2) NOT NULL,
	[NotAvailableBalance] [decimal](18, 2) NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_dbo.WebAccountBalances] PRIMARY KEY CLUSTERED 
(
	[WebAccountBalanceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[UserBases]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[UserBases](
	[UserID] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](50) NOT NULL,
	[CreateDate] [datetime] NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
	[Status] [int] NOT NULL,
	[Email] [varchar](100) NOT NULL,
	[Password] [varchar](100) NOT NULL,
	[Tel] [varchar](50) NULL,
	[QQ] [varchar](50) NULL,
	[TelVerify] [varchar](100) NULL,
	[ConfirmCode] [nchar](10) NULL,
	[IDType] [int] NOT NULL,
	[IDNumber] [varchar](30) NOT NULL,
 CONSTRAINT [PK_dbo.UserBases] PRIMARY KEY CLUSTERED 
(
	[UserID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[UserAccountRecords]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[UserAccountRecords](
	[UserAccountRecordID] [varchar](36) NOT NULL,
	[UserID] [bigint] NOT NULL,
	[Amount] [decimal](18, 2) NOT NULL,
	[Balance] [decimal](18, 2) NOT NULL,
	[FlowType] [int] NOT NULL,
	[ActionType] [int] NOT NULL,
	[Note] [varchar](500) NULL,
	[OrderID] [varchar](50) NULL,
	[BankName] [varchar](100) NULL,
	[CreateDate] [datetime] NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
	[Operator] [varchar](50) NULL,
	[Status] [int] NOT NULL,
 CONSTRAINT [PK_dbo.UserAccountRecords] PRIMARY KEY CLUSTERED 
(
	[UserAccountRecordID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[UserAccountFreezeRecords]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[UserAccountFreezeRecords](
	[UserAccountFreezeRecordID] [varchar](36) NOT NULL,
	[UserID] [bigint] NOT NULL,
	[Amount] [decimal](18, 2) NOT NULL,
	[Type] [int] NOT NULL,
	[FreezeType] [int] NOT NULL,
	[OrderID] [varchar](15) NULL,
	[Note] [varchar](200) NOT NULL,
	[Status] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
	[Operator] [varchar](50) NULL,
 CONSTRAINT [PK_dbo.UserAccountFreezeRecords] PRIMARY KEY CLUSTERED 
(
	[UserAccountFreezeRecordID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[UserAccountBalances]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UserAccountBalances](
	[UserID] [bigint] NOT NULL,
	[TotalBalance] [decimal](18, 2) NOT NULL,
	[NotAvailableBalance] [decimal](18, 2) NOT NULL,
	[AllowForPay] [bit] NOT NULL,
	[RefreshDate] [datetime] NOT NULL,
 CONSTRAINT [PK_dbo.UserAccountBalances] PRIMARY KEY CLUSTERED 
(
	[UserID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[User_Extensions]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[User_Extensions](
	[UserID] [bigint] NOT NULL,
	[RealName] [varchar](50) NULL,
	[Address] [varchar](200) NULL,
 CONSTRAINT [PK_dbo.User_Extensions] PRIMARY KEY CLUSTERED 
(
	[UserID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[StaticInfo]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[StaticInfo](
	[StaticID] [int] IDENTITY(1,1) NOT NULL,
	[Title] [varchar](200) NOT NULL,
	[Info] [nvarchar](4000) NULL,
	[CreateDate] [datetime] NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
	[Status] [int] NOT NULL,
 CONSTRAINT [PK_dbo.StaticInfo] PRIMARY KEY CLUSTERED 
(
	[StaticID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Shop]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Shop](
	[ShopID] [int] IDENTITY(1,1) NOT NULL,
	[ShopName] [varchar](200) NOT NULL,
	[AreaID] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
	[Status] [int] NOT NULL,
	[Info] [nvarchar](4000) NULL,
 CONSTRAINT [PK_dbo.Shop] PRIMARY KEY CLUSTERED 
(
	[ShopID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[RentalRecord]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[RentalRecord](
	[ID] [bigint] IDENTITY(1,1) NOT NULL,
	[ProductID] [bigint] NOT NULL,
	[UserID] [bigint] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
	[UpateDate] [datetime] NOT NULL,
	[ReturnCity] [varchar](100) NOT NULL,
	[ReturnShop] [varchar](100) NOT NULL,
	[Status] [int] NOT NULL,
	[StartTime] [datetime] NOT NULL,
	[EndTime] [datetime] NOT NULL,
	[Price] [decimal](18, 0) NOT NULL,
	[OrderItemID] [varchar](36) NOT NULL,
 CONSTRAINT [PK_dbo.RentalRecord] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[ProductPropertyType]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ProductPropertyType](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](100) NOT NULL,
	[Status] [int] NOT NULL,
 CONSTRAINT [PK_dbo.ProductPropertyType] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[ProductProperty]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ProductProperty](
	[PropertyID] [int] IDENTITY(1,1) NOT NULL,
	[PropertyName] [varchar](200) NOT NULL,
	[Info] [varchar](500) NULL,
	[PropertyTypeID] [int] NOT NULL,
 CONSTRAINT [PK_dbo.ProductProperty] PRIMARY KEY CLUSTERED 
(
	[PropertyID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Product_Property_R]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Product_Property_R](
	[ProductID] [bigint] NOT NULL,
	[ProductPropertyID] [int] NOT NULL,
	[SortNumber] [int] NOT NULL,
 CONSTRAINT [PK_dbo.Product_Property_R] PRIMARY KEY CLUSTERED 
(
	[ProductID] ASC,
	[ProductPropertyID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Product]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Product](
	[ProductID] [bigint] IDENTITY(1,1) NOT NULL,
	[ProductName] [varchar](250) NULL,
	[CategoryID] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
	[Status] [int] NOT NULL,
	[Info] [nvarchar](500) NULL,
	[MarketPrice] [decimal](18, 2) NOT NULL,
	[RealPrice] [decimal](18, 2) NOT NULL,
	[Discount] [int] NULL,
	[ProductCount] [int] NOT NULL,
	[Image] [varchar](500) NULL,
	[SmallImage] [varchar](500) NULL,
	[PropertyInfo] [varchar](500) NULL,
 CONSTRAINT [PK_dbo.Product] PRIMARY KEY CLUSTERED 
(
	[ProductID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[PkIdTable]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[PkIdTable](
	[IDNum] [int] NOT NULL,
	[Code] [varchar](100) NOT NULL,
	[About] [varchar](50) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[OrderItem]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[OrderItem](
	[OrderItemID] [varchar](36) NOT NULL,
	[OrderID] [bigint] NOT NULL,
	[ProductID] [bigint] NOT NULL,
	[ProductName] [varchar](100) NOT NULL,
	[Quantity] [int] NOT NULL,
	[SalePrice] [decimal](18, 2) NOT NULL,
	[Status] [int] NOT NULL,
 CONSTRAINT [PK_dbo.OrderItem] PRIMARY KEY CLUSTERED 
(
	[OrderItemID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Order]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Order](
	[OrderID] [bigint] IDENTITY(1,1) NOT NULL,
	[BuyerUserID] [varchar](12) NOT NULL,
	[OrderAmount] [decimal](18, 2) NOT NULL,
	[ProductSaleAmount] [decimal](18, 2) NOT NULL,
	[ShippingAmount] [decimal](18, 2) NOT NULL,
	[PayType] [int] NOT NULL,
	[ShippingMethods] [varchar](300) NOT NULL,
	[InvoiceAmount] [decimal](18, 2) NOT NULL,
	[TaxAmount] [decimal](18, 2) NOT NULL,
	[OrderStatus] [int] NOT NULL,
	[InvoiceTitle] [varchar](200) NULL,
	[InvoiceBody] [varchar](200) NULL,
	[Note] [varchar](4000) NULL,
	[RankCommentStatus] [int] NOT NULL,
	[IsDelivery] [bit] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
	[Status] [int] NOT NULL,
	[IsInvoice] [bit] NOT NULL,
 CONSTRAINT [PK_dbo.[Order]]] PRIMARY KEY CLUSTERED 
(
	[OrderID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[News]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[News](
	[NewsID] [bigint] IDENTITY(1,1) NOT NULL,
	[HelpCategoryID] [int] NOT NULL,
	[Title] [varchar](100) NOT NULL,
	[InfoSummary] [varchar](500) NULL,
	[Info] [ntext] NULL,
	[Status] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
	[DisplayDate] [datetime] NOT NULL,
 CONSTRAINT [PK_dbo.News] PRIMARY KEY CLUSTERED 
(
	[NewsID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[LevelMsg]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[LevelMsg](
	[LevelMsgID] [bigint] IDENTITY(1,1) NOT NULL,
	[Title] [nvarchar](250) NOT NULL,
	[Info] [nvarchar](4000) NULL,
	[CreateDate] [datetime] NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
	[Status] [int] NOT NULL,
	[FromUser] [int] NOT NULL,
 CONSTRAINT [PK_dbo.LevelMsg] PRIMARY KEY CLUSTERED 
(
	[LevelMsgID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[HelperCenterCategory]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[HelperCenterCategory](
	[HelpCategoryID] [int] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](200) NOT NULL,
	[ParentID] [bigint] NOT NULL,
	[SortNumber] [int] NOT NULL,
 CONSTRAINT [PK_dbo.HelperCenterCategory] PRIMARY KEY CLUSTERED 
(
	[HelpCategoryID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[HelperCenter]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[HelperCenter](
	[HelpID] [int] IDENTITY(1,1) NOT NULL,
	[HelpCategoryID] [int] NOT NULL,
	[Title] [varchar](200) NOT NULL,
	[Info] [ntext] NULL,
	[CreateDate] [datetime] NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
	[Status] [int] NOT NULL,
 CONSTRAINT [PK_dbo.HelperCenter] PRIMARY KEY CLUSTERED 
(
	[HelpID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[CheckCodeRecords]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[CheckCodeRecords](
	[CheckCode] [varchar](36) NOT NULL,
	[Description] [varchar](200) NOT NULL,
 CONSTRAINT [PK_dbo.CheckCodeRecords] PRIMARY KEY CLUSTERED 
(
	[CheckCode] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Category]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Category](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](50) NULL,
	[ParentID] [int] NULL,
	[SortNumber] [int] NOT NULL,
 CONSTRAINT [PK_dbo.Category] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Block]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Block](
	[BlockID] [int] IDENTITY(1,1) NOT NULL,
	[BlockName] [varchar](100) NOT NULL,
	[BlockURL] [varchar](200) NULL,
	[Status] [int] NOT NULL,
	[Type] [int] NOT NULL,
	[SortNumber] [int] NOT NULL,
 CONSTRAINT [PK_dbo.Block] PRIMARY KEY CLUSTERED 
(
	[BlockID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Area]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Area](
	[CodeID] [int] NOT NULL,
	[ParentID] [int] NOT NULL,
	[Name] [varchar](100) NOT NULL,
	[Status] [int] NOT NULL,
 CONSTRAINT [PK_dbo.Area] PRIMARY KEY CLUSTERED 
(
	[CodeID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[AdvertisementArea]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AdvertisementArea](
	[AdvertisementAreaID] [varchar](36) NOT NULL,
	[Name] [varchar](300) NOT NULL,
	[HTML] [ntext] NULL,
	[Summary] [ntext] NOT NULL,
	[Type] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
	[Operator] [varchar](50) NOT NULL,
 CONSTRAINT [PK_dbo.AdvertisementArea] PRIMARY KEY CLUSTERED 
(
	[AdvertisementAreaID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Advertisement]    Script Date: 11/04/2013 09:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Advertisement](
	[AdvertisementID] [varchar](36) NOT NULL,
	[AdvertisementAreaID] [varchar](36) NOT NULL,
	[CategoryID] [varchar](40) NULL,
	[Name] [varchar](50) NOT NULL,
	[CreateDate] [datetime] NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
	[StartDate] [datetime] NOT NULL,
	[Status] [int] NOT NULL,
	[HTML] [ntext] NOT NULL,
	[Operator] [varchar](50) NOT NULL,
 CONSTRAINT [PK_dbo.Advertisement] PRIMARY KEY CLUSTERED 
(
	[AdvertisementID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
